import md5 from './md5'
import axios from 'axios'
const baseUrl = 'https://www.meiboshi.vip/api/'
const sendRequest = {
  post: function (url, data) {
    return new Promise(function (resolve, reject) {
      axios.post(baseUrl + url, data)
        .then(function (res) {
          if (res.code == 200) {
            resolve(res.data.datas)
          } else if (res.code == 201) {
            console.log('超时登录')
          } else {
            resolve(res.data)
          }
        })
        .catch(function (error) {
          console.log(error)
        })
    })
  }
}

export default sendRequest